import { createApp } from 'vue'
import App from './App.vue'
import { router } from '/@/router'
import { setupStore } from '/@/store'
import Antd from 'ant-design-vue';
import 'ant-design-vue/dist/antd.css';
import './style.css'
import Dict from '/@/components/Dict';
import PageWrapper from '/@/components/PageWrapper';
import Table from '/@/components/Table';
import Icons from '/@/components/Icon';
import Form from '/@/components/Form';
import Crud from '/@/components/Crud';
import Modal from '/@/components/Modal';
import Drawer from '/@/components/Drawer';

import Directives from './directives';
import { useUserStore } from '/@/store/modules/user';
import { useMenuStore } from '/@/store/modules/menu';
const app = createApp(App)
setupStore(app)
app.use(router)
app.use(Antd)
app.use(Directives)
//app.component('Dict',Dict)
app.use(Dict as any)
app.use(PageWrapper as any)
app.use(Table as any)
app.use(Icons as any)
app.use(Form as any)
app.use(Crud as any)
app.use(Modal as any)
app.use(Drawer as any)

const userStore = useUserStore()
// 初始化权限标识
await userStore.initPermCode()
// 初始化用户信息
userStore.getUserInfo()
// 初始化路由菜单
const menuStore = useMenuStore();
menuStore.initMenu()
app.mount('#app')
